package top.rainbowecho.ai.domain.model.robot;

import top.rainbowecho.ai.domain.model.robot.value.*;
import top.rainbowecho.ai.domain.model.robot.value.talk.Talk;
import top.rainbowecho.ai.domain.model.robot.value.talk.TalkAnswer;
import top.rainbowecho.common.domain.shared.vo.SensitiveRecognizeResult;

import java.io.IOException;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.TimeoutException;

/**
 * Ai机器人的能力接口
 *
 * @author rainbow
 * @since 2019/11/24 12:29
 */
public interface IAiRobot {
    /**
     * AI闲聊能力
     *
     * @param talk 用户会话对象
     * @return 机器人应答
     * @throws IOException 反序列化失败抛出异常
     */
    AiReply<TalkAnswer> talk(Talk talk) throws IOException, InterruptedException, ExecutionException, TimeoutException;

    /**
     * 提供图片暴恐，图片鉴黄能力
     *
     *
     * @param imageCode@return 鉴别结果
     * @throws IOException json反序列化失败
     */
    SensitiveRecognizeResult sensitiveImageCheck(String imageCode) throws IOException, InterruptedException, ExecutionException, TimeoutException;

    /**
     * 使用百度云文本审核接口
     *
     * @param text 审核文本
     * @return 鉴别结果
     */
    SensitiveRecognizeResult textCheck(String text) throws IOException;
}
